#include "stdafx.h"
#include "BUTTON_DRAWING.h"
namespace DIRECT2D_ENGINE {
	ID2D1HwndRenderTarget* BUTTON_DRAWING::pRenderTarget = NULL;
	IWICImagingFactory *BUTTON_DRAWING::m_pWICFactory=NULL;
	IDWriteFactory * BUTTON_DRAWING::m_WriteFactory=NULL;

	void DIRECT2D_ENGINE::BUTTON_DRAWING::Update(int New_Index)
	{
		index = New_Index;
		return;
	}

	void DIRECT2D_ENGINE::BUTTON_DRAWING::Render()
	{
		Graphics gr(pRenderTarget, m_pWICFactory, m_WriteFactory);
		if (Visible == false) return;
		switch (Type)
		{
		case BUTTON_PLAY:
			gr.Draw_Bitmap(BUTTON_tPLAY, index, Current_x, Current_y, width, height); return;
		case BUTTON_DISCARD:
			gr.Draw_Bitmap(BUTTON_tDISCARD, index, Current_x, Current_y, width, height); return;
		case BUTTON_CALL:
			gr.Draw_Bitmap(BUTTON_tCall, index, Current_x, Current_y, width, height); return;
		case BUTTON_NOCALL:
			gr.Draw_Bitmap(BUTTON_tNoCall, index, Current_x, Current_y, width, height); return;
		case BUTTON_CONTINUE:
			gr.Draw_Bitmap(BUTTON_tContinue, index, Current_x, Current_y, width, height); return;
		case BUTTON_EXIT:
			gr.Draw_Bitmap(BUTTON_tExit, index, Current_x, Current_y, width, height); return;
		case BUTTON_GRAB:
			gr.Draw_Bitmap(BUTTON_tGrab, index, Current_x, Current_y, width, height); return;
		case BUTTON_NOGRAB:
			gr.Draw_Bitmap(BUTTON_tNoGrab, index, Current_x, Current_y, width, height); return;
		case BUTTON_X2:
			gr.Draw_Bitmap(BUTTON_tX2, index, Current_x, Current_y, width, height); return;
		case BUTTON_NOX2:
			gr.Draw_Bitmap(BUTTON_tNoX2, index, Current_x, Current_y, width, height); return;
		}
	}
}